package com.slliver.product.controller;


import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/product")
public class ProductController {

    @Value("${server.port}")
    private String port;

    @GetMapping("/get/{id}")
    public String get(@PathVariable("id") Long id) throws InterruptedException {
        System.out.println("商品服务调用success...");
//        Thread.sleep(3 * 1000);
        return "商品服务【" + port + "】被调用, 调用的 id是 ==>> " + id;
    }

}
